Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

task.php in command line => wrong argv assumptions

#16

task.php assumes that $_SERVER[ 'argv' ][ 0 ] is a numeric ID of a task to run. In actuality, it's the script that is being run ...

$:php task.php

ARGV == array ( 0 => 'task.php' )

Here is a replacement for the end of task.php which corrects this, and add type checking

if( !empty( $VAR[ 'id' ] ) && is_numeric( $VAR[ 'id' ] ) ) {

$task->id = $VAR[ 'id' ];

} else if( isset( $SERVER[ 'argv' ] ) && count( $SERVER[ 'argv' ] ) > 1 && isset( $SERVER[ 'argv' ][ 1 ] ) && is_numeric( $SERVER[ 'argv' ][ 1 ] ) ) {

$task->id = $_SERVER[ 'argv'][ 1 ];

}

Reported by leprechaun · March 13th, 2009 @ 11:45 AM

State: new
Milestone: none
Assigned to: Scott Scott

Activity

  1. Scott
    Scott

    I will test this and submit it next patch.

    March 25th, 2009 @ 07:05 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.